import request from '@/request/index.js'
const zhpt = 'zhpt' //http://101.42.107.47:30018文档
const base = 'base' //http://101.42.107.47:30020文档

//自定义消息列表查询
export const getCustomInfoListApi = (data) => {
    return request({
        url: `/api/${zhpt}/message/custom/list`,
        method: 'POST',
        data,
    })
}

//获取所有推送群体
export const getPushGroupListApi = () => {
    return request({
        url: `/api/${base}/api/role/all/push`,
        method: 'GET',
    })
}

//自定义消息新增
export const customInfoAddApi = (data) => {
    return request({
        url: `/api/${zhpt}/message/custom/add`,
        method: 'POST',
        data,
    })
}

//自定义消息编辑
export const customInfoEditApi = (data) => {
    return request({
        url: `/api/${zhpt}/message/custom/edit`,
        method: 'POST',
        data,
    })
}

//自定义消息推送
export const customInfoPushApi = (data) => {
    return request({
        url: `/api/${zhpt}/message/custom/push`,
        method: 'POST',
        data,
    })
}

//消息模版列表查询
export const getInfoTemplateListApi = (params) => {
    return request({
        url: `/api/${zhpt}/message/template/list`,
        method: 'GET',
        params,
    })
}

//消息模版编辑
export const infoTemplateEditApi = (data) => {
    return request({
        url: `/api/${zhpt}/message/template/edit`,
        method: 'POST',
        data,
    })
}

//自定义消息批量操作
export const customInfoBatchApi = (data) => {
    return request({
        url: `/api/${zhpt}/message/custom/batch`,
        method: 'POST',
        data,
    })
}

//获取自定义消息详情
export const customInfoDetailsApi = (params) => {
    return request({
        url: `/api/${zhpt}/message/custom/info`,
        method: 'GET',
        params,
    })
}

//获取自定义消息阅读明细
export const customInfoReadDetailApi = (params) => {
    return request({
        url: `/api/${zhpt}/message/custom/info/userList`,
        method: 'GET',
        params,
    })
}